From c8319436cfd4b68bf2ae92e65e3e848cd1d35cfc Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 3 Sep 2007 22:42:28 +0000 Subject: [PATCH] GPX: Read archived/active state from Pocket Queries. KML: Read track name. --- defs.h | 2 ++ gpx.c | 8 ++++++++ kml.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/defs.h b/defs.h index 0a29c5443..47bd4b2fe 100644 --- a/defs.h +++ b/defs.h @@ -233,6 +233,8 @@ typedef struct { geocache_container container:4; unsigned int diff:6; /* (multiplied by ten internally) */ unsigned int terr:6; /* (likewise) */ + unsigned int is_archived:1; + unsigned int is_available:1; time_t exported; time_t last_found; char *placer; /* Placer name */ diff --git a/gpx.c b/gpx.c index 7e9bc3232..cd7ed9f05 100644 --- a/gpx.c +++ b/gpx.c @@ -480,6 +480,14 @@ tag_gs_cache(const char **attrv) for (avp = &attrv[0]; *avp; avp+=2) { if (strcmp(avp[0], "id") == 0) { wpt_tmp->gc_data.id = atoi(avp[1]); + } else if (strcmp(avp[0], "available") == 0) { + if (strcmp(avp[1], "True") == 0) { + wpt_tmp->gc_data.is_available = 1; + } + } else if (strcmp(avp[0], "archived") == 0) { + if (strcmp(avp[1], "True") == 0) { + wpt_tmp->gc_data.is_archived = 1; + } } } } diff --git a/kml.c b/kml.c index 90cc9b671..62e339624 100644 --- a/kml.c +++ b/kml.c @@ -208,6 +208,9 @@ void trk_coord(const char *args, const char **attrv) waypoint *trkpt; route_head *trk_head = route_head_alloc(); + if (wpt_tmp->shortname) { + trk_head->rte_name = xstrdup(wpt_tmp->shortname); + } track_add_head(trk_head); while (3 == sscanf(args,"%lf,%lf,%lf %n", &lon, &lat, &alt, &consumed)){ -- 2.30.2